/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class LisCharginitemTest extends Model<LisCharginitemTest>{
      public static final LisCharginitemTest lisCharginitemTestdao=new LisCharginitemTest();
   
    public void saveCitemTest(String ITEMID,String TESTID,String SAMPLETYPE,String TESTPK,String ITEMPK){
        set("ITEMID",ITEMID)
                .set("TESTID", TESTID)
                .set("DATA1", SAMPLETYPE)
                .set("TESTPK", TESTPK)
                .set("ITEMPK", ITEMPK)
                .save();
    }
    public void delectCitemTest(String TESTID,String ITEMID){//删除该收费项目中的某一小项
        Db.use("mysql").update("delete from lis_charginitem_test where TESTID=? and ITEMID=?",TESTID,ITEMID);
    }
     public void delectCitemTests(String SAMPLETYPE,String ITEMID){//删除该收费项目有关样本类型的所有小项
        Db.use("mysql").update("delete from lis_charginitem_test where DATA1=? and ITEMID=?",SAMPLETYPE,ITEMID);
    }
     
    public void updateTestpk(int ITEMID,int PK,String TESTID,int TESTPK,int ITEMPK){
        findById(ITEMID,PK,TESTID)
                .set("TESTPK", TESTPK)
                .set("ITEMPK", ITEMPK)
                .update();
                
    }
    
}
